Correctly terminate created string. From Mark Bradley.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 14 Oct 2003 13:20:00 +0000 (13:20 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 14 Oct 2003 13:20:00 +0000 (13:20 +0000)
gpsbabel/util.c

index 5219a6606b922be616e643ea5c02d09d82c88623..de96b5959394c70aa75ae0e41b74aa24bbc8a6a9 100644 (file)
@@ -171,7 +171,7 @@ xstrndupt(const char *str, size_t sz)
 
        newstr = xmalloc(newlen + 1);
        memcpy(newstr, str, newlen);
-       newstr[newlen+1] = '\0';
+       newstr[newlen] = '\0';
        rtrim(newstr);
 
        return newstr;